home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / Windows / System32 / HTMLRE90.DLL / HTML / 11057 < prev    next >
Encoding:
Text File  |  2002-07-05  |  35.6 KB  |  1,089 lines

  1. <HTML>
  2. <HEAD>
  3. <LINK REL="stylesheet" TYPE="text/css" HREF="%2css/default.css">
  4.  
  5. <script language="Javascript">
  6. //LOCALIZATION STRINGS
  7. var _errNullPrompt = "Prompt is null.";
  8. var _errSingleCurrValue = "doListBox: single current value expected";
  9. var _errSingleDefaultValue = "doListBox: single default value expected";
  10. var _strAddBtn = "Add";
  11. var _strRemoveBtn = "Remove";
  12. var _strStartRange = "Start Of Range:";
  13. var _strEndRange = "End of Range:";
  14. var _strInclude = "include value";
  15. var _strNoLower = "no lower bound";
  16. var _strNoUpper = "no upper bound";
  17. var _strRangeError = "The start of range cannot be greater than the end of range."
  18.  
  19. // strings that need localization - don't localize anything not listed here
  20. var L_BadNumber        = "This parameter is of type \"Number\" and can only contain a negative sign, digits (\"0-9\"), and a period decimal separator. Please correct the entered parameter value.";
  21. var L_BadCurrency    = "This parameter is of type \"Currency\" and can only contain a negative sign, digits (\"0-9\"), and a period decimal separator. Please correct the entered parameter value.";
  22. var L_BadDate        = "This parameter is of type \"Date\" and should be in the format \"Date(yyyy,mm,dd)\" where \"yyyy\" is the four digit year, \"mm\" is the month (e.g. January = 1), and \"dd\" is the number of days into the given month.";
  23. var L_BadDateTime   = "This parameter is of type \"DateTime\" and the correct format is \"DateTime(yyyy,mm,dd,hh,mm,ss)\". \"yyyy\" is the four digit year, \"mm\" is the month (e.g. January = 1), \"dd\" is the day of the month, \"hh\" is hours in a 24 hour, \"mm\" is minutes and \"ss\" is seconds.";
  24. var L_BadTime       = "This parameter is of type \"Time\" and should be in the format \"Time(hh,mm,ss)\" where \"hh\" is hours in 24 a hour clock, \"mm\" is minutes into the hour, and \"ss\" is seconds into the minute.";
  25. var L_EmptyBoolean  = "This parameter is of type \"Boolean\" and can not have an empty value.";
  26.  
  27. // string that set to null value
  28. var _strSetToNull      = "Set to NULL value";
  29. var _strPromptAtViewTime = "Prompt the user for new value(s) when viewing";
  30. var _strClearPromptValue = "Clear the current parameter value(s)";
  31. var _strEmpty = "[EMPTY]";
  32. var _currentVal = "Current Values:"; 
  33.  
  34. </script>
  35.  
  36. <script>
  37. var linkPath = "%3";
  38. </script>
  39.  
  40. <script src="%3js/KeyDownEvent.js"></script>
  41. <script src="%3js/calendar.js"></script>
  42. <script src="%3js/parameter.js"></script>
  43. <script src="%4js/FormChek.js"></script>
  44.  
  45.  
  46. <script>
  47. var prompt = null;
  48.  
  49. function getParameter() {
  50.   var i     = -1;
  51.   var query = window.location.search;
  52.  
  53.   if ( query.length > 1 ) query = query.substring ( 1, query.length );
  54.   pp = query.split ( '&' );
  55.   for (var j=0; j<pp.length; j++) {
  56.     arg = pp[j].split( '=' );
  57.     if (arg.length == 2 && arg[0] == "i") i = arg[1];
  58.   }
  59.  
  60.   prompt = parent.promptArray[i];
  61.   return prompt;
  62. }
  63.  
  64.  
  65. //FUNCTION TO TOGGLE THE INCLUDE UPPER/LOWER BOUND CHECKBOX ON OR OFF
  66. function ToggleBound( thisB, otherB, thisI, otherI )
  67. {
  68.     if ( thisB.checked )
  69.     {
  70.         otherB.disabled = true;
  71.         thisI.disabled = true;
  72.     }
  73.     else
  74.     {
  75.         thisI.disabled = false;
  76.         if ( !otherI.checked )
  77.             otherB.disabled = false;
  78.     }
  79. }
  80.  
  81.  
  82. //FUNCTION TO TOGGLE THE NO UPPER/LOWER BOUND CHECKBOX ON OR OFF
  83. function ToggleInclude( thisI, thisB, otherB )
  84. {
  85.     if ( thisI.checked )
  86.     {
  87.         thisB.disabled = true;
  88.     }
  89.     else
  90.     {
  91.         if ( !otherB.checked )
  92.             thisB.disabled = false;
  93.     }
  94. }
  95.  
  96.  
  97. function init ( ) {
  98.   var prompt = getParameter();
  99.  
  100.   if ( prompt.supportsDiscreteValues && !prompt.supportsRangeValues) {
  101.     if ( prompt.enableMultipleValues )
  102.       doMultipleSingleValues (prompt);
  103.     else
  104.       doSingleValue (prompt);
  105.   }
  106.   else if ( !prompt.supportsDiscreteValues && prompt.supportsRangeValues) {
  107.     if ( prompt.enableMultipleValues )
  108.       doMultipleRangeValues (prompt);
  109.     else
  110.       doRangeValue (prompt);
  111.   }
  112.   else {
  113.     doDiscreteRangeValue(prompt);
  114.   }
  115.   displayClearValue(prompt); 
  116.  
  117.   displayPromptAtViewTime(prompt);
  118. }
  119.  
  120. function displayNullCheckBox()
  121. {
  122.   if (prompt.enableNullValue)
  123.   {
  124.      document.writeln('<tr><td class="list">');
  125.      if (document.layers)
  126.         document.writeln('<form name="nullform">');
  127.      document.writeln('<input type="checkbox" name="nullcheckbox"> </td>');
  128.      if (document.layers)
  129.         document.writeln('</form>');
  130.  
  131.      if (prompt.currentValues.length != 0)
  132.      {
  133.         if (prompt.currentValues[0].IsNullValue)
  134.         {
  135.            if (document.layers)
  136.                this.document.forms.nullform.nullcheckbox.checked = true;
  137.            else
  138.                this.document.forms.param.nullcheckbox.checked = true;
  139.         }
  140.      }
  141.      document.writeln('<td class="list"> <div>'+  _strSetToNull + ' </div> </td></tr>');
  142.   }
  143. }
  144.  
  145. function displayPromptAtViewTime(prompt)
  146. {
  147.      
  148.      if (document.layers)
  149.         document.writeln('<form name="viewtimeform">');
  150.      
  151.     document.writeln('<table>');     
  152.     document.writeln('<tr><td class="list">');     
  153.     document.writeln('<input type="checkbox" name="viewtimecheckbox"> </td>');
  154.      
  155.     if (prompt.PromptAtViewTime)
  156.     {
  157.            if (document.layers)
  158.                this.document.forms.viewtimeform.viewtimecheckbox.checked = true;
  159.            else
  160.                this.document.forms.param.viewtimecheckbox.checked = true;
  161.     }
  162.     document.writeln('<td class="list">'+  _strPromptAtViewTime + '</td></tr>');
  163.     document.writeln('</table>');     
  164.  
  165.     if (document.layers)
  166.         document.writeln('</form>');
  167.  
  168. }
  169.  
  170. function displayClearValue(prompt)
  171. {
  172.     if (document.layers)
  173.         document.writeln('<form name="clearform">');
  174.      
  175.     document.writeln('<table>');     
  176.     document.writeln('<tr><td class="list">');     
  177.     document.writeln('<input type="checkbox" name="clearcheckbox"> </td>');
  178.      
  179.     document.writeln('<td class="list">'+  _strClearPromptValue + '</td></tr>');
  180.     document.writeln('</table>');     
  181.  
  182.     if (document.layers)
  183.         document.writeln('</form>');
  184. }
  185.  
  186. function submit () {
  187.  
  188.   var prompt = getParameter();
  189.  
  190.   if ( prompt.supportsDiscreteValues && !prompt.supportsRangeValues) {
  191.     if ( prompt.enableMultipleValues )
  192.       submitMultipleSingleValues (prompt);
  193.     else
  194.       if (submitSingleValue ( prompt) == -1)
  195.          return;
  196.   }
  197.   else if ( !prompt.supportsDiscreteValues && prompt.supportsRangeValues) {
  198.     if ( prompt.enableMultipleValues )
  199.       submitMultipleRangeValues ( prompt);
  200.     else
  201.       if (submitRangeValue ( prompt) == -1)
  202.          return;
  203.   }
  204.   else {
  205.     submitDiscreteRangeValue(prompt);
  206.   }
  207.  
  208.   submitViewAtRunTime(prompt); 
  209.   submitClearValue(prompt); 
  210.  
  211.   prompt.isCurrentValueSet = true;
  212.   location.href = "%1";
  213. }
  214.  
  215. function swap(name) {
  216.   if (prompt)
  217.     swapDDCtrl(name, prompt);
  218.   else
  219.     alert(_errNullPrompt);
  220. }
  221.  
  222. // to hold the discrete value in the case discrete and range
  223. var g_mResultList = new Array();
  224.  
  225. var g_mDiscreteList = new Array();
  226. ////////////////////////////////////////////////////////////////
  227. function submitDiscreteRangeValue( prompt)
  228. {
  229.   if (prompt.enableNullValue)
  230.   {
  231.      if (document.layers)
  232.      {
  233.         if (this.document.forms.nullform.nullcheckbox.checked)
  234.         {
  235.            prompt.AddNullCurrentValue();
  236.            return;
  237.         }
  238.      }
  239.      else
  240.      {
  241.         if (this.document.forms.param.nullcheckbox.checked)
  242.         {
  243.            prompt.AddNullCurrentValue();
  244.            return;
  245.         }
  246.      }
  247.   }
  248.  
  249.   // if reach here, the prompt is not a nullable one.
  250.   submitMultipleRangeValues(prompt);
  251.  
  252.   for (var i=0; i<g_mDiscreteList.length; i++) {
  253.      if (g_mDiscreteList[i]) prompt.AddSingleCurrentValue(g_mDiscreteList[i]);
  254.   }
  255.  
  256. }
  257.  
  258. function submitMultipleSingleValues(prompt)
  259. {
  260.   if (prompt.enableNullValue)
  261.   {
  262.      if (document.layers)
  263.      {
  264.         if (this.document.forms.nullform.nullcheckbox.checked)
  265.         {
  266.            prompt.AddNullCurrentValue();
  267.            return;
  268.         }
  269.      }
  270.      else
  271.      {
  272.         if (this.document.forms.param.nullcheckbox.checked)
  273.         {
  274.            prompt.AddNullCurrentValue();
  275.            return;
  276.         }
  277.      }
  278.   }
  279.  
  280.   prompt.ClearCurrentValues();
  281.   var list;
  282.   if (document.layers)
  283.     list = document.forms.valueListForm.valuelist;
  284.   else
  285.     list = document.forms.param.valuelist;
  286.  
  287.   for (var i=0; i<list.length; i++) {
  288.     prompt.AddSingleCurrentValue(list.options[i].value);
  289.   }
  290. }
  291.  
  292. function submitRangeValue(prompt)
  293. {
  294.   if (prompt.enableNullValue)
  295.   {
  296.      if (document.layers)
  297.      {
  298.         if (this.document.forms.nullform.nullcheckbox.checked)
  299.         {
  300.            prompt.AddNullCurrentValue();
  301.            return;
  302.         }
  303.      }
  304.      else
  305.      {
  306.         if (this.document.forms.param.nullcheckbox.checked)
  307.         {
  308.            prompt.AddNullCurrentValue();
  309.            return;
  310.         }
  311.      }
  312.   }
  313.  
  314.   var param = prompt.edtbox.getRangeValue();
  315.   if (param == -1)
  316.      return -1;
  317.  
  318.   var start = "", end = "", iu = false, il = false, nu = false, nl = false;
  319.   start = param.fromValue;
  320.   end   = param.toValue;
  321.   iu    = param.includesUpperBound;
  322.   nu    = param.hasNoUpperBound;
  323.   il    = param.includesLowerBound;
  324.   nl    = param.hasNoLowerBound;
  325.  
  326.   prompt.ClearCurrentValues();
  327.   prompt.AddRangeCurrentValue(start,end,iu,il,nu,nl);
  328. }
  329.  
  330. function submitMultipleRangeValues ( prompt)
  331. {
  332.   if (prompt.enableNullValue)
  333.   {
  334.      if (document.layers)
  335.      {
  336.         if (this.document.forms.nullform.nullcheckbox.checked)
  337.         {
  338.            prompt.AddNullCurrentValue();
  339.            return;
  340.         }
  341.      }
  342.      else
  343.      {
  344.         if (this.document.forms.param.nullcheckbox.checked)
  345.         {
  346.            prompt.AddNullCurrentValue();
  347.            return;
  348.         }
  349.      }
  350.   }
  351.  
  352.   prompt.ClearCurrentValues();
  353.   for (var i=0; i<g_mResultList.length; i++) {
  354.     if (g_mResultList[i]) {
  355.       prompt.AddRangeCurrentValue(g_mResultList[i].fromValue,
  356.                                   g_mResultList[i].toValue,
  357.                                   g_mResultList[i].includesUpperBound,
  358.                                   g_mResultList[i].includesLowerBound,
  359.                                   g_mResultList[i].hasNoUpperBound,
  360.                                   g_mResultList[i].hasNoLowerBound);
  361.     }
  362.   }
  363. }
  364.  
  365. function submitViewAtRunTime( prompt )
  366. {
  367.      if (document.layers)
  368.      {
  369.         if (this.document.forms.viewtimeform.viewtimecheckbox.checked)
  370.         {
  371.            prompt.PromptAtViewTime = true;
  372.            return;
  373.         }
  374.         else prompt.PromptAtViewTime = false;
  375.      }
  376.      else
  377.      {
  378.         if (this.document.forms.param.viewtimecheckbox.checked)
  379.         {
  380.            prompt.PromptAtViewTime = true;
  381.            return;
  382.         }
  383.         else prompt.PromptAtViewTime = false;
  384.      }
  385. }
  386.  
  387. function submitClearValue( prompt )
  388. {
  389.      if (document.layers)
  390.      {
  391.         if (this.document.forms.clearform.clearcheckbox.checked)
  392.         {
  393.            prompt.ClearCurrentValues();
  394.            return;
  395.         }
  396.      }
  397.      else
  398.      {
  399.         if (this.document.forms.param.clearcheckbox.checked)
  400.         {
  401.            prompt.ClearCurrentValues();
  402.            return;
  403.         }
  404.      }
  405. }
  406.  
  407.  
  408. function doMultipleRangeValues (prompt)
  409. {
  410.   var il = false, nl = false, iu = false, nu = false;
  411.   if ( prompt.currentValues != null && prompt.currentValues.length >= 1 && prompt.currentValues[0].IsRangeValue ) {
  412.     il = prompt.currentValues[0].rangeValue.includesLowerBound;
  413.     iu = prompt.currentValues[0].rangeValue.includesUpperBound;
  414.     nl = prompt.currentValues[0].rangeValue.hasNoLowerBound;
  415.     nu = prompt.currentValues[0].rangeValue.hasNoUpperBound;
  416.   }
  417.  
  418.   document.writeln('<table>');
  419.   document.writeln('<tr><td class="list" width="150" valign="top">' + _strStartRange + '</td>');
  420.   document.writeln('<td class="list">');
  421.   var ctrl = new EditableDropDown (prompt);
  422.   ctrl.WriteMultipleItems("FromPrompt", true);
  423.   document.writeln('</td><td class="list">');
  424.   document.writeln('</td>');
  425.   document.writeln('</tr>');
  426.  
  427.   document.writeln('<tr><td class="list"></td><td class="list">');
  428.   if (document.layers)
  429.   {
  430.      document.writeln('<form name="lowerForm">');
  431.      writeCheckbox('includesLower', _strInclude, il, '');
  432.      writeCheckbox('hasNoLower', _strNoLower, nl, '');      
  433.      document.writeln('</form>');
  434.   }
  435.   else
  436.   {
  437.      writeCheckbox('includesLower', _strInclude, il, 'ToggleInclude(document.forms.param.includesLower, document.forms.param.hasNoLower, document.forms.param.hasNoUpper);'); 
  438.      writeCheckbox('hasNoLower', _strNoLower, nl, 'ToggleBound(document.forms.param.hasNoLower, document.forms.param.hasNoUpper, document.forms.param.includesLower, document.forms.param.includesUpper);');
  439.   }
  440.   document.writeln('</td><td class="list"></td></tr>');
  441.  
  442.   document.writeln('<tr><td class="list" valign="top">' + _strEndRange + '</td>');
  443.   document.writeln('<td class="list">');
  444.   var ctrl = new EditableDropDown (prompt);
  445.   ctrl.WriteMultipleItems("ToPrompt", false);
  446.   document.writeln('</td><td class="list"></td> </tr>');
  447.  
  448.   document.writeln('<tr><td class="list"></td><td class="list">');
  449.   if (document.layers)
  450.   {
  451.         document.writeln('<form name="upperForm">');
  452.         writeCheckbox('includesUpper', _strInclude, iu, ''); 
  453.         writeCheckbox('hasNoUpper', _strNoUpper, nu, '');
  454.         document.writeln('</form>');
  455.   }
  456.   else
  457.   {
  458.         writeCheckbox('includesUpper', _strInclude, iu, 'ToggleInclude(document.forms.param.includesUpper, document.forms.param.hasNoUpper, document.forms.param.hasNoLower);');
  459.         writeCheckbox('hasNoUpper', _strNoUpper, nu, 'ToggleBound(document.forms.param.hasNoUpper, document.forms.param.hasNoLower, document.forms.param.includesUpper, document.forms.param.includesLower);');
  460.   }
  461.  
  462.   // init for checkboxes
  463.   if (document.layers == null)
  464.   {
  465.         ToggleInclude(document.forms.param.includesLower, document.forms.param.hasNoLower, document.forms.param.hasNoUpper);
  466.         ToggleBound(document.forms.param.hasNoLower, document.forms.param.hasNoUpper, document.forms.param.includesLower, document.forms.param.includesUpper);
  467.         ToggleInclude(document.forms.param.includesUpper, document.forms.param.hasNoUpper, document.forms.param.hasNoLower);
  468.         ToggleBound(document.forms.param.hasNoUpper, document.forms.param.hasNoLower, document.forms.param.includesUpper, document.forms.param.includesLower);
  469.   }
  470.   document.writeln('</td></tr>');
  471.   document.writeln('</table>'); 
  472.  
  473.   document.writeln('<table border=0 cellpadding=0>');
  474.   document.writeln('<tr><td colspan = 2 class="list"></td>');
  475.  
  476.   document.writeln('<td class="list">');
  477.  
  478.   document.writeln('<table cellpadding=0 border=0><tr><td class="clsButton" align=middle nowrap>');
  479.             
  480.   if (document.layers)
  481.     document.writeln('<div class="clsButton"><a href="javascript: addRangeItem(this.document.forms.valueListForm.valuelist)">' + _strAddBtn + '</a></div>');
  482.   else
  483.     document.writeln('<div class="clsButton"><a href="javascript: addRangeItem(this.document.forms.param.valuelist)">' + _strAddBtn + '</a></div>');
  484.  
  485.   document.writeln('</td></tr></table>');
  486.  
  487.   document.writeln('</td></tr>'); 
  488.    
  489.   // seperator
  490.  
  491.   document.writeln('<tr><td class="list" colspan=3><hr size="1"></td></tr>');
  492.  
  493.   document.writeln('<tr><td class="list" width="150">' + _currentVal + '</td><td>');
  494.  
  495.  
  496.   if (document.layers)
  497.      document.writeln('<form name="valueListForm">');
  498.  
  499.   document.writeln('<select name="valuelist" size=5>');
  500.   document.writeln('<option> This is a formatting ...................... string ');
  501.   document.writeln('</select>');
  502.   
  503.   if (document.layers)
  504.     document.writeln('</form>'); 
  505.   
  506.   document.writeln('</td>'); 
  507.   document.writeln('<td class="list" valign="top">');
  508.  
  509.   document.writeln('<table cellpadding=0 border=0><tr><td class="clsButton" align=middle nowrap>');
  510.   if (document.layers)
  511.       document.writeln('<div class="clsButton"><a href="javascript: removeDiscreteRangeItem(this.document.forms.valueListForm.valuelist)">' + _strRemoveBtn + '</a></div>');
  512.   else
  513.       document.writeln('<div class="clsButton"><a href="javascript: removeDiscreteRangeItem(this.document.forms.param.valuelist)">' + _strRemoveBtn + '</a></div>');
  514.  
  515.   document.writeln('</td></tr></table>');
  516.   document.writeln('</td></tr>'); 
  517.  
  518.   displayNullCheckBox();
  519.  
  520.   document.writeln('</table>');
  521.  
  522.   var dest;
  523.   if (document.layers)
  524.   {
  525.         dest = this.document.forms.valueListForm.valuelist;
  526.         dest.options[0] = null;
  527.   }
  528.   else
  529.   {
  530.         dest = this.document.forms.param.valuelist;
  531.         dest.options[0] = null;
  532.   }
  533.  
  534.   for (var i=0; i < prompt.currentValues.length; i++) 
  535.   {
  536.       if (prompt.currentValues[i].IsRangeValue)
  537.       {
  538.         addRangeString (prompt.currentValues[i].rangeValue.fromValue,
  539.                       prompt.currentValues[i].rangeValue.toValue,
  540.                       prompt.currentValues[i].rangeValue.includesLowerBound,
  541.                       prompt.currentValues[i].rangeValue.hasNoLowerBound,
  542.                       prompt.currentValues[i].rangeValue.includesUpperBound,
  543.                       prompt.currentValues[i].rangeValue.hasNoUpperBound,
  544.                       dest, prompt.editMask);
  545.       }
  546.       else if (prompt.currentValues[i].IsSingleValue)
  547.       {
  548.         addDiscreteString(prompt.currentValues[i].singleValue.value,
  549.                         dest, prompt.editMask);
  550.       }
  551.   }  // end for
  552. }
  553.  
  554. function writeCheckbox(name, str, checked, onclickhandler)
  555. {
  556.   document.writeln('<input type="checkbox" name="' + name + '" value="true" ');
  557.   if (checked) document.writeln('checked');
  558.  
  559.   if (onclickhandler.length > 0)
  560.   {
  561.      document.writeln(' onClick="' + onclickhandler + '"'); 
  562.   }
  563.   document.writeln(' >');
  564.   document.writeln(str);
  565. }
  566.  
  567. function doRangeValue (prompt)
  568. {
  569.   var il = false, nl = false, iu = false, nu = false;
  570.   if ( prompt.currentValues != null && prompt.currentValues.length >= 1 && prompt.currentValues[0].IsRangeValue ) {
  571.     il = prompt.currentValues[0].rangeValue.includesLowerBound;
  572.     iu = prompt.currentValues[0].rangeValue.includesUpperBound;
  573.     nl = prompt.currentValues[0].rangeValue.hasNoLowerBound;
  574.     nu = prompt.currentValues[0].rangeValue.hasNoUpperBound;
  575.   }
  576.  
  577.   document.writeln('<table>');
  578.   document.writeln('<tr><td class="list" width="150" valign="top">' + _strStartRange + '</td>');
  579.   document.writeln('<td class="list">');
  580.   var ctrl = new EditableDropDown (prompt);
  581.   ctrl.WriteMultipleItems("FromPrompt", true);
  582.   document.writeln('</td></tr>');
  583.   document.writeln('<tr><td class="list"> </td> <td class="list">');
  584.   if (document.layers)
  585.   {
  586.     document.writeln('<form name="lowerForm">');
  587.     writeCheckbox('includesLower', _strInclude, il, '');
  588.     writeCheckbox('hasNoLower', _strNoLower, nl, '');
  589.     document.writeln('</form>');
  590.   }
  591.   else 
  592.   {
  593.     writeCheckbox('includesLower', _strInclude, il, 'ToggleInclude(document.forms.param.includesLower, document.forms.param.hasNoLower, document.forms.param.hasNoUpper);');
  594.     writeCheckbox('hasNoLower', _strNoLower, nl, 'ToggleBound(document.forms.param.hasNoLower, document.forms.param.hasNoUpper, document.forms.param.includesLower, document.forms.param.includesUpper);');
  595.   }
  596.   document.writeln('</td></tr>');
  597.  
  598.   document.writeln('<tr><td class="list" valign="top">' + _strEndRange + '</td>');
  599.   document.writeln('<td class="list">');
  600.   var ctrl = new EditableDropDown (prompt);
  601.   ctrl.WriteMultipleItems("ToPrompt", false);
  602.   document.writeln('</td></tr>');
  603.   document.writeln('<tr><td class="list"></td><td class="list">');
  604.   if (document.layers)
  605.   {
  606.     document.writeln('<form name="upperForm">');
  607.     writeCheckbox('includesUpper', _strInclude, iu, '');
  608.     writeCheckbox('hasNoUpper', _strNoUpper, nu, '');
  609.     document.writeln('</form>');
  610.   }
  611.   else
  612.   {    
  613.     writeCheckbox('includesUpper', _strInclude, iu, 'ToggleInclude(document.forms.param.includesUpper, document.forms.param.hasNoUpper, document.forms.param.hasNoLower);');
  614.     writeCheckbox('hasNoUpper', _strNoUpper, nu, 'ToggleBound(document.forms.param.hasNoUpper, document.forms.param.hasNoLower, document.forms.param.includesUpper, document.forms.param.includesLower);');
  615.   }
  616.  
  617.   // init for checkboxes
  618.   if (document.layers == null)
  619.   {
  620.     ToggleInclude(document.forms.param.includesLower, document.forms.param.hasNoLower, document.forms.param.hasNoUpper);
  621.     ToggleBound(document.forms.param.hasNoLower, document.forms.param.hasNoUpper, document.forms.param.includesLower, document.forms.param.includesUpper);
  622.     ToggleInclude(document.forms.param.includesUpper, document.forms.param.hasNoUpper, document.forms.param.hasNoLower);
  623.     ToggleBound(document.forms.param.hasNoUpper, document.forms.param.hasNoLower, document.forms.param.includesUpper, document.forms.param.includesLower);
  624.   }
  625.   document.writeln('</td></tr>');
  626.  
  627.   displayNullCheckBox();
  628.  
  629.   document.writeln('</table>');
  630. }
  631.  
  632. function addRangeItem(dest) 
  633. {
  634.   var param = prompt.edtbox.getRangeValue ( );
  635.   if (param == -1)
  636.       return;
  637.  
  638.   var start = "", end = "", iu = false, il = false, nu = false, nl = false;
  639.   
  640.   start = param.fromValue;
  641.   end   = param.toValue;
  642.   iu    = param.includesUpperBound;
  643.   nu    = param.hasNoUpperBound;
  644.   il    = param.includesLowerBound;
  645.   nl    = param.hasNoLowerBound;
  646.  
  647.   addRangeString(start,end,il,nl,iu,nu,dest, prompt.editMask);
  648. }
  649.  
  650. function addRangeString(from,to,il,nl,iu,nu,dest, editMask) {
  651.  
  652.   var item = new parameterRangeValue(from, to, iu, il, nu, nl, editMask);
  653.   var str  = item.ValueDisplayString ();
  654.  
  655.   for (var i=0; i<dest.length; i++) {
  656.     if (dest.options[i].value == str)
  657.       return;
  658.   }
  659.  
  660.   dest.options[dest.length] = new Option(str, str);
  661.   g_mResultList[g_mResultList.length] = item;
  662. }
  663.  
  664. // remove item from the global array
  665. function removeDiscreteRangeItem(dest) {
  666.   if ( dest.selectedIndex >= 0 ) {
  667.     var str = dest.options[dest.selectedIndex].value;
  668.     for (var i=0; i<g_mResultList.length; i++) {
  669.       if ( g_mResultList[i] && g_mResultList[i].ValueDisplayString() == str ) {
  670.         g_mResultList[i] = null;
  671.         break;
  672.       }
  673.     }
  674.  
  675.     for (var i=0; i<g_mDiscreteList.length; i++) { 
  676.       if ( g_mDiscreteList[i] && g_mDiscreteList[i] == str ) {
  677.         g_mDiscreteList[i] = null;
  678.         break;
  679.       }
  680.     }
  681.  
  682.     dest.options[dest.selectedIndex] = null;
  683.   }
  684. }
  685.  
  686. function addItemString(string, dest)
  687. {
  688.   if (string != "") {
  689.     for (var i=0; i<dest.length; i++) {
  690.       if (dest.options[i].value == string)
  691.         return;
  692.     }
  693.     dest.options[dest.length] = new Option(string, string);
  694.   }
  695. }
  696.  
  697. function addItem(dest) 
  698. {
  699.   var param = prompt.edtbox.getSingleValue();
  700.   if (param == -1)
  701.       return;
  702.   addItemString(param.value, dest);
  703. }
  704.  
  705. function removeItem(dest) {
  706.   for (var i=0; i<dest.length; i++) {
  707.     if (dest.options[i].selected) {
  708.       dest.options[i] = null;
  709.       return;
  710.     }
  711.   }
  712. }
  713.  
  714. // return true if s is in the string array
  715. function contains(strarray, s)
  716. {
  717.   for (var i=0; i<strarray.length; i++) {
  718.     if ( strarray[i] == s ) return true;
  719.   }
  720.   return false;
  721. }
  722.  
  723. function doListBox (edit, defaults, currents)
  724. {
  725.   document.writeln('<select onchange="OnChangeListItem()" name="value">');
  726.  
  727.   var itemsInList = new Array();
  728.   if (currents != null) {
  729.     for (var i=0; i<currents.length; i++) {
  730.       if (currents[i].IsSingleValue) {
  731.         itemsInList[itemsInList.length] = currents[i].singleValue.value;
  732.         document.writeln('<option selected value="' + currents[i].singleValue.value + '">' + currents[i].ValueDisplayString() );
  733.       } else {
  734.         alert(_errSingleCurrValue);
  735.       }
  736.     }
  737.   }
  738.  
  739.   for (var i=0; i<defaults.length; i++) {
  740.     if (defaults[i].IsSingleValue) {
  741.       str = defaults[i].singleValue.value;
  742.       display = defaults[i].ValueDisplayString();
  743.       if ( !contains(itemsInList, str) ) {
  744.         document.writeln('<option value="' + str + '">' + display );
  745.       }
  746.     } else {
  747.       alert(_errSingleDefaultValue);
  748.     }
  749.   }
  750.   document.writeln('</select>');
  751. }
  752.  
  753. function submitSingleValue(prompt)
  754. {
  755.   if (prompt.enableNullValue)
  756.   {
  757.      if (document.layers)
  758.      {
  759.         if (this.document.forms.nullform.nullcheckbox.checked)
  760.         {
  761.            prompt.AddNullCurrentValue();
  762.            return;
  763.         }
  764.      }
  765.      else
  766.      {
  767.         if (this.document.forms.param.nullcheckbox.checked)
  768.         {
  769.            prompt.AddNullCurrentValue();
  770.            return;
  771.         }
  772.      }
  773.   }
  774.  
  775.   prompt.ClearCurrentValues();
  776.   var param = prompt.edtbox.getSingleValue();
  777.   if (param == -1)
  778.          return -1;
  779.   prompt.AddSingleCurrentValue(param.value);
  780. }
  781.  
  782. function doSingleValue(prompt)
  783. {
  784.   document.writeln('<table border=0><tr><td class="list" colspan="2">');
  785.   document.writeln(prompt.prompt);
  786.   document.writeln('</td></tr><tr><td class="list" width="150" valign="top">');
  787.   document.writeln(prompt.name);
  788.   document.writeln('</td><td class="list" valign="top">');
  789.   var ctrl = new EditableDropDown (prompt);
  790.   ctrl.WriteSingleItem("Prompt");
  791.   document.writeln('</td></tr>');
  792.  
  793.   displayNullCheckBox();
  794.  
  795.   document.writeln('</table>');
  796. }
  797.  
  798. function doMultipleSingleValues(prompt)
  799. {
  800.   document.writeln('<table border="0"><tr><td class="list" colspan="3">');
  801.   document.writeln(prompt.prompt);
  802.   document.writeln('<td class="list"> </tr><tr><td class="list" width="150" valign="top">');
  803.   document.writeln(prompt.name);
  804.   document.writeln('</td><td class="list" valign="top">');
  805.   var ctrl = new EditableDropDown(prompt);
  806.   ctrl.WriteSingleItem("Prompt");
  807.   document.writeln('</td><td class="list" valign="top">');
  808.  
  809.   // add button
  810.   document.writeln('<table border="0" cellpadding=0>');
  811.   document.writeln('<tr>');
  812.   document.writeln('<td class="clsButton" align=middle valign="top" nowrap>');
  813.   if (document.layers)
  814.      document.writeln('<div class="clsButton"><a href="javascript: addItem(this.document.forms.valueListForm.valuelist)">' + _strAddBtn + '</a></div>');
  815.   else
  816.      document.writeln('<div class="clsButton"><a href="javascript: addItem(this.document.forms.param.valuelist)">' + _strAddBtn + '</a></div>');
  817.   document.writeln('</td>');
  818.   document.writeln('</tr>');
  819.   document.writeln('</table>');
  820.  
  821.   document.writeln('</td></tr></table>'); 
  822.  
  823.   document.writeln('<table>');
  824.   document.writeln('<tr><td class="list" colspan="3"><hr size="1"></td></tr>');
  825.   document.writeln('<tr><td class="list" width="150">' +  _currentVal + '</td><td>');
  826.  
  827.   if (document.layers)
  828.      document.writeln('<form name="valueListForm">');
  829.   document.writeln('<select name="valuelist" size=5>');
  830.  
  831.   if ((document.layers) && (prompt.currentValues.length == 0))
  832.      document.writeln('<option> This is a formatting ...................... string ');
  833.  
  834.   for (var i=0; i<prompt.currentValues.length; i++) {
  835.     document.writeln('<option value="' + prompt.currentValues[i].singleValue.value + '">' + prompt.currentValues[i].ValueDisplayString());
  836.   }
  837.   document.writeln('</select>');
  838.   if (document.layers)
  839.      document.writeln('</form>');
  840.  
  841.   document.writeln('</td><td class="list" valign="top">');
  842.  
  843.   document.writeln('<table border="0" cellpadding=0>');
  844.   document.writeln('<tr>');
  845.   document.writeln('<td class="clsButton" align=middle nowrap>');
  846.   if (document.layers)
  847.        document.writeln('<div class="clsButton"><a href="javascript: removeItem(this.document.forms.valueListForm.valuelist)">' + _strRemoveBtn + '</a></div>');
  848.   else
  849.        document.writeln('<div class="clsButton"><a href="javascript: removeItem(this.document.forms.param.valuelist)">' + _strRemoveBtn + '</a></div>');
  850.   document.writeln('</td></tr>');
  851.   document.writeln('</table>');
  852.  
  853.   document.writeln('</td></tr>');
  854.   
  855.   displayNullCheckBox();
  856.  
  857.   document.writeln('</table>');
  858.  
  859.   if ((document.layers) && (prompt.currentValues.length == 0))
  860.   {
  861.   //netscape
  862.         dest = this.document.forms.valueListForm.valuelist;
  863.         dest.options[0] = null;
  864.   }
  865.   else if (prompt.currentValues.length == 0)
  866.   {
  867.     //ie
  868.         dest = this.document.forms.param.valuelist;
  869.         dest.options[0] = null;
  870.   }
  871. }
  872.  
  873. function addDiscreteString(s, dest)
  874. {
  875.   g_mDiscreteList[g_mDiscreteList.length] = s;
  876.   addItemString(s,dest);
  877. }
  878.  
  879. function addDiscreteItem(dest)
  880. {
  881.   var param = prompt.edtbox.getSingleValue();
  882.   if (param == -1)
  883.      return;
  884.   addDiscreteString(param.value, dest);
  885. }
  886.  
  887. function doDiscreteRangeValue(prompt)
  888. {
  889.   document.writeln('<table border=0><tr><td class="list" colspan="3">');
  890.   document.writeln(prompt.prompt);
  891.   document.writeln('</td></tr><tr><td class="list" width="150" valign="top">');
  892.   document.writeln(prompt.name);
  893.   document.writeln('</td><td class="list" valign="top">');
  894.   var ctrl = new EditableDropDown (prompt);
  895.   ctrl.WriteSingleItem("Prompt");
  896.   document.writeln('</td><td class="list">');
  897.     // add button
  898.     document.writeln('<table border="0" cellpadding=0>');
  899.     document.writeln('<tr>');
  900.     document.writeln('<td class="clsButton" align=middle nowrap>');
  901.     if (document.layers)
  902.         document.writeln('<div class="clsButton"><a href="javascript: addDiscreteItem(this.document.forms.valueListForm.valuelist)">' + _strAddBtn + '</a></div>');
  903.     else
  904.         document.writeln('<div class="clsButton"><a href="javascript: addDiscreteItem(this.document.forms.param.valuelist)">' + _strAddBtn + '</a></div>');
  905.     document.writeln('</td>');
  906.     document.writeln('</tr>');
  907.     document.writeln('</table>');
  908.  
  909.   document.writeln('</td></tr>');
  910.   document.writeln('<tr><td class="list" colspan=2><hr size="1"></td></tr>');
  911.   document.writeln('</table>'); 
  912.  
  913.   var il = false, nl = false, iu = false, nu = false;
  914.   if ( prompt.currentValues != null && prompt.currentValues.length >= 1 && prompt.currentValues[0].IsRangeValue ) {
  915.     il = prompt.currentValues[0].rangeValue.includesLowerBound;
  916.     iu = prompt.currentValues[0].rangeValue.includesUpperBound;
  917.     nl = prompt.currentValues[0].rangeValue.hasNoLowerBound;
  918.     nu = prompt.currentValues[0].rangeValue.hasNoUpperBound;
  919.   }
  920.  
  921.   document.writeln('<table>'); 
  922.   document.writeln('<tr><td class="list" width="150" valign="top">' + _strStartRange + '</td>');
  923.   document.writeln('<td class="list">');
  924.   var ctrl = new EditableDropDown (prompt);
  925.   ctrl.WriteMultipleItems("FromPrompt", true);
  926.   document.writeln('</td></tr>');
  927.  
  928.   document.writeln('<tr><td class="list"></td><td class="list">');
  929.   
  930.   if (document.layers)
  931.   {
  932.     document.writeln('<form name="lowerForm">');
  933.     writeCheckbox('includesLower', _strInclude, il, '');
  934.     writeCheckbox('hasNoLower', _strNoLower, nl, '' );
  935.     document.writeln('</form>');
  936.   }
  937.   else 
  938.   {
  939.     writeCheckbox('includesLower', _strInclude, il, 'ToggleInclude(document.forms.param.includesLower, document.forms.param.hasNoLower, document.forms.param.hasNoUpper);');
  940.     writeCheckbox('hasNoLower', _strNoLower, nl, 'ToggleBound(document.forms.param.hasNoLower, document.forms.param.hasNoUpper, document.forms.param.includesLower, document.forms.param.includesUpper);');
  941.   }
  942.  
  943.   document.writeln('</td><td class="list"></td></tr>');
  944.  
  945.   document.writeln('<tr><td class="list" valign="top">' + _strEndRange + '</td>');
  946.   document.writeln('<td class="list">');
  947.   var ctrl = new EditableDropDown (prompt);
  948.   ctrl.WriteMultipleItems("ToPrompt", false);
  949.   document.writeln('</td><td class="list"></td> </tr>');
  950.  
  951.   document.writeln('<tr><td class="list"></td><td class="list">');
  952.   if (document.layers)
  953.   {
  954.     document.writeln('<form name="upperForm">');
  955.     writeCheckbox('includesUpper', _strInclude, iu, '');
  956.     writeCheckbox('hasNoUpper', _strNoUpper, nu, '');
  957.     document.writeln('</form>');
  958.   }
  959.   else
  960.   {
  961.     writeCheckbox('includesUpper', _strInclude, iu, 'ToggleInclude(document.forms.param.includesUpper, document.forms.param.hasNoUpper, document.forms.param.hasNoLower);');
  962.     writeCheckbox('hasNoUpper', _strNoUpper, nu, 'ToggleBound(document.forms.param.hasNoUpper, document.forms.param.hasNoLower, document.forms.param.includesUpper, document.forms.param.includesLower);');
  963.   }
  964.  
  965.   // init for checkboxes
  966.   if (document.layers == null)
  967.   {
  968.     ToggleInclude(document.forms.param.includesLower, document.forms.param.hasNoLower, document.forms.param.hasNoUpper);
  969.     ToggleBound(document.forms.param.hasNoLower, document.forms.param.hasNoUpper, document.forms.param.includesLower, document.forms.param.includesUpper);
  970.     ToggleInclude(document.forms.param.includesUpper, document.forms.param.hasNoUpper, document.forms.param.hasNoLower);
  971.     ToggleBound(document.forms.param.hasNoUpper, document.forms.param.hasNoLower, document.forms.param.includesUpper, document.forms.param.includesLower);
  972.   }
  973.  
  974.   document.writeln('</td></tr>');
  975.   document.writeln('</table>'); 
  976.   
  977.   // add button  
  978.   document.writeln('<table>');  
  979.   document.writeln('<tr><td colspan=2 class="list"></td><td align=right>'); 
  980.   document.writeln('<table border="0" cellpadding=0>');
  981.   document.writeln('<tr>');
  982.   document.writeln('<td class="clsButton" align=middle nowrap>');
  983.   if (document.layers)
  984.     document.writeln('<div class="clsButton"><a href="javascript: addRangeItem(this.document.forms.valueListForm.valuelist)">' + _strAddBtn + '</a></div>');
  985.   else
  986.     document.writeln('<div class="clsButton"><a href="javascript: addRangeItem(this.document.forms.param.valuelist)">' + _strAddBtn + '</a></div>');
  987.   document.writeln('</td>');
  988.   document.writeln('</tr>');
  989.   document.writeln('</table>');
  990.   document.writeln('</td></tr>'); 
  991.   
  992.   document.writeln('<tr><td class="list" colspan=3><hr size="1"></td></tr>');
  993.   document.writeln('<tr><td class="list" width="150">' + _currentVal + '</td><td>');
  994.  
  995.   if (document.layers)
  996.      document.writeln('<form name="valueListForm">');
  997.  
  998.   document.writeln('<select name="valuelist" size=5>');
  999.   document.writeln('<option> This is a formatting ...................... string ');
  1000.   document.writeln('</select>');
  1001.  
  1002.   if (document.layers)
  1003.      document.writeln('</form>');
  1004.  
  1005.   document.writeln('</td><td class="list" valign="top" align=right>');
  1006.  
  1007. // remove button
  1008.     document.writeln('<table border="0" cellpadding=0>');
  1009.     document.writeln('<tr>');
  1010.     document.writeln('<td class="clsButton" align=middle nowrap>');
  1011.     if (document.layers)
  1012.         document.writeln('<div class="clsButton"><a href="javascript: removeDiscreteRangeItem(this.document.forms.valueListForm.valuelist)">' + _strRemoveBtn + '</a></div>');
  1013.     else
  1014.         document.writeln('<div class="clsButton"><a href="javascript: removeDiscreteRangeItem(this.document.forms.param.valuelist)">' + _strRemoveBtn + '</a></div>');
  1015.     document.writeln('</td></tr>');
  1016.     document.writeln('</table>');
  1017.  
  1018.  
  1019.   document.writeln('</td></tr>');
  1020.  
  1021.   displayNullCheckBox();
  1022.   
  1023.   document.writeln('</table>');
  1024.  
  1025.   var dest;
  1026.   if (document.layers)
  1027.   {
  1028.         dest = this.document.forms.valueListForm.valuelist;
  1029.         dest.options[0] = null;
  1030.   }
  1031.   else
  1032.   {
  1033.         dest = this.document.forms.param.valuelist;
  1034.         dest.options[0] = null;
  1035.   }
  1036.   for (var i=0; i<prompt.currentValues.length; i++) {
  1037.       if (prompt.currentValues[i].IsRangeValue)
  1038.       {
  1039.         addRangeString (prompt.currentValues[i].rangeValue.fromValue,
  1040.                       prompt.currentValues[i].rangeValue.toValue,
  1041.                       prompt.currentValues[i].rangeValue.includesLowerBound,
  1042.                       prompt.currentValues[i].rangeValue.hasNoLowerBound,
  1043.                       prompt.currentValues[i].rangeValue.includesUpperBound,
  1044.                       prompt.currentValues[i].rangeValue.hasNoUpperBound,
  1045.                       dest, 
  1046.                       prompt.editMask);
  1047.       }
  1048.       else if (prompt.currentValues[i].IsSingleValue)
  1049.       {
  1050.         addDiscreteString(prompt.currentValues[i].singleValue.value,
  1051.                         dest);
  1052.       }
  1053.   } 
  1054.   // end for
  1055. }
  1056.  
  1057. </script>
  1058. </HEAD>
  1059. <BODY LEFTMARGIN="50" >
  1060.  
  1061. <DIV ID="tooltip" STYLE="position:absolute;visibility:hidden;z-index:99;"></DIV>
  1062.  
  1063. <SCRIPT SRC="%5js/helps.js"></SCRIPT>
  1064. <SCRIPT SRC="%6js/tips.js"></SCRIPT>
  1065.  
  1066. <SPAN CLASS="clsUserInstruction">Set the initial value for this parameter</SPAN>
  1067. <BR>
  1068.  
  1069. <FORM NAME="param" onsubmit="return false;">
  1070. <script>
  1071. init();
  1072. </script>
  1073. <br> <br> <br>
  1074.   <table border=0 align="right" cellpadding=0>
  1075.   <tr valign=center>
  1076.   <td class="clsButton" align=middle nowrap>
  1077.   <div class="clsButton"><a href="javascript: submit()" onMouseOver="St(7);window.status='';return true;" onMouseOut="Ht()">OK</a></div>
  1078.   </td>
  1079.   <td class="clsButton" align=middle nowrap>
  1080.   <div class="clsButton"><a href="#" onClick="javascript: history.back();return false" onMouseOver="St(8);window.status='';return true;" onMouseOut="Ht()">Cancel</a></div>
  1081.   </td>
  1082.   </tr>
  1083.   </table>
  1084. </FORM>
  1085.  
  1086.  
  1087. </BODY>
  1088. </HTML>
  1089.